import { defineStore } from 'pinia'
import axios from 'axios';
import mockAxios from '../plugins/mock_axios';
import _ from 'lodash';

const myaxios=mockAxios(axios);

export const useBaseStore = defineStore({

  id: 'base',
  state: () => ({
  }),
  getters: {
   // doubleCount: (state) => state.counter * 2
  },
  actions: {
/**
 * 根据id 返回对应的考情表信息的数据数组（含详情）
 * @param {*} attendId 
 */
    async fetchAttendenceWithDetailArray(attendId){

      return myaxios.get(`/attendenceWithDetailArray/${attendId}`,{ r: 
        [{id:1,state:'已确认',curriculumId:1,teacherId:1,teacherName:'刘笑锋', courseId:1, courseName:'数据库分析与设计' ,clazzId:1,clazzName:'软件2202',startFrom:230212203,hours:3,detailId:123,studentId:1,studentName:'张三',studentState:'缺勤'},
        {id:1,state:'已确认',curriculumId:1,teacherId:1,teacherName:'刘笑锋', courseId:1, courseName:'数据库分析与设计' ,clazzId:1,clazzName:'软件2202',startFrom:230212203,hours:3,detailId:124,studentId:2,studentName:'李四',studentState:'已签'}    
        ]})
    },
  }
})
